<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>animation属性演示</title>
    <style>
        @keyframes slide {
            from {
                left: 0;
                top: 0;
            }

            50% {
                left: 50%;
                top: 50%;
            }

            to {
                left: calc(100% - 50px);
            }
        }

        .stage {
            background: darkseagreen;
            border-radius: 6px;
            height: 150px;
            position: relative;
            width: 500px;
        }

        .stage:hover .ball {
            animation: slide 2s linear;
        }

        .ball {
            background: darksalmon;
            border-radius: 50%;
            height: 50px;
            position: absolute;
            width: 50px;
            margin: 0;
        }

    </style>
</head>

<body>
    <div class="stage">
        <figure class="ball"></figure>
    </div>

</body>

</html>
